package com.ktjy.entity;

import java.util.List;

public class Page {
    //总页数
    private int page;
    //页面显示信息量
    private int rows;
    //总记录
    private int total;
    //当前页面
    private int totalPage=1;
    //当前页面信息
    private List<Book> list;

    public int offset(){
        return (totalPage-1) * rows;
    }

    public List<Book> getList() {
        return list;
    }

    public void setList(List<Book> list) {
        this.list = list;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        double pageRow=(double) total/rows;
        this.page= (int) Math.ceil(pageRow);
        this.total = total;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }
}
